﻿<%@ Page Title="" Language="C#" MasterPageFile="~/en-us/Site.Master" AutoEventWireup="true" CodeBehind="Product.aspx.cs" Inherits="Web_HengliSeed.en_us.Product" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script src="../JavaScript/Jquery.js" type="text/javascript"></script>
    <link href="../Style/basic.css" rel="stylesheet" type="text/css" />
    <script src="../JavaScript/jquery.simplemodal.js" type="text/javascript"></script>
    
    <script type="text/javascript">
        function Show() {
            $('#basicModalContent').modal();
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div id="content_main">
        <h1>Products</h1>
        <br />
        <div class="list_results">
            <div class="box gutter_right" >
                <h2><%=Title %></h2>
                <span><a href="#" onclick="Show();">I am interested in</a></span>
                    <p>
                        <%=Image %>
                    </p>
                    <%=Content %>
        </div>
        </div>
        <div id="content_secondary" style="">
            <div id="nav_page">
                <div id="sub-nav" class="gradient_1">
                    <ul>
                        <li class="active"><a href="#">Product Categories</a>
                            <%=GetProClass()%>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <form runat="server" id="Form1">
    <script type="text/javascript">
        function check() {
            if ($("#<%=txtUserName.ClientID %>").val() == "") {
                alert("Name can not be empty.");
                $("#<%=txtUserName.ClientID %>").focus();
                return false;
            }
            if ($("#<%=txtPhone.ClientID %>").val() == "") {
                alert("Phone can not be empty.");
                $("#<%=txtPhone.ClientID %>").focus();
                return false;
            }
            if ($("#<%=txtEmail.ClientID %>").val() == "") {
                alert("Email can not be empty");
                $("#<%=txtEmail.ClientID %>").focus();
                return false;
            }

            return true;
        }

        function send() {
            if (!check())
                return;
            $.ajax({
                type: "GET",
                url: "../Product.ashx",
                dataType: "html",
                data: "title=" + encodeURI("<%=Title %>") + "&name=" + encodeURI($("#<%=txtUserName.ClientID %>").val()) + "&phone=" + encodeURI($("#<%=txtPhone.ClientID %>").val()) + "&email=" + encodeURI($("#<%=txtEmail.ClientID %>").val()),
                beforeSend: function (XMLHttpRequest) {
                    //$("#showResult").text("正在查询");
                    //Pause(this,100000);
                },
                success: function (msg) {
                    if (msg == "ok") {
                        alert("Sent successfully");
                        $("#<%=txtUserName.ClientID %>").val("");
                        $("#<%=txtPhone.ClientID %>").val("");
                        $("#<%=txtEmail.ClientID %>").val("");
                    }
                },
                complete: function (XMLHttpRequest, textStatus) {
                    //隐藏正在查询图片
                },
                error: function () {
                    //错误处理
                }
            });
        }

    </script>
    <div id="basicModalContent" style="width: 360px; height: 300px; overflow-y: auto; display:none;">
        <table>
            <tr>
                <td>
                        Your Name:
                </td>
            </tr>
            <tr>
                <td>
                    <asp:TextBox runat="server" ID="txtUserName" Width="300px" Height="28px" />
                </td>
            </tr>
            <tr>
                <td>
                        Your Phone:
                </td>
            </tr>
            <tr>
                <td>
                    <asp:TextBox runat="server" ID="txtPhone" Width="300px" Height="28px" />
                </td>
            </tr>
            <tr>
                <td>
                        Your Email:
                </td>
            </tr>
            <tr>
                <td>
                    <asp:TextBox runat="server" ID="txtEmail" Width="300px" Height="28px" />
                </td>
            </tr>
            <tr>
                <td>
                    <a href="#" onclick="send();" >Send</a>
                </td>
            </tr>
        </table>
    </div>
    </form>
</asp:Content>
